<?php
/**
 * Created by PhpStorm.
 * User: 刘红波 <liuhb@cqjcdflzxsws.com>
 * Date: 2018/11/20
 * Time: 14:43
 */

namespace app\api\until\es;

use Elasticsearch\Common\Exceptions\Curl\CouldNotResolveHostException;

use app\api\until\ESearch;
use app\api\until\es\ESConf as ES;

class Indices extends ESearch implements ES
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 创建indices
     * @return array
     */
    public function createIndices()
    {
        return $this->getClient()->indices()->create($this->data);
    }

    /**
     * 删除indices
     * @return array
     */
    public function deleteIndices(){
        return $this->getClient()->indices()->delete($this->data);
    }

    /**
     * 判断索引是否存在
     */
    public function isExits(){
        return $this->getClient()->indices()->exists($this->data);
    }
}